package cc.eevee.jni.libdynamic;

import android.util.Log;

public class Math {

  public static final double PI = java.lang.Math.PI;
  public static final double PI_2 = PI / 2;

  public static native double toRadians(double deg);
  public static native double toDegrees(double rad);

  public static native double sin(double rad);
  public static native double asin(double rad);

  public static native double cos(double rad);
  public static native double acos(double rad);

  public static native double tan(double rad);
  public static native double atan(double rad);
  public static native double atan2(double y, double x);

  static {
    try {
      System.loadLibrary("math");
    } catch (Exception e) {
      Log.e(Math.class.getSimpleName(), "load native library failed");
      e.printStackTrace();
    }
  }

}
